/**
 * 退出登录
 * @param {string} msg 退出登录信息
 */
export function logout(msg) {
  const app = getApp()
  if (app.globalData.isFail) {
    return
  }
  app.globalData.isFail = true
  // app.clearLogin()
  wx.showModal({
    content: msg || '登录失效,请重新登录',
    showCancel: false,
    success: function () {
      app.globalData.isFail = false
			app.clearLogin()
      wx.switchTab({
        url: '/pages/user/index',
      })
    }
  })
}